package com.four.utils;

import lombok.Data;

/**
 * @ClassName JsonResout
 * @Description json工具
 * @Author Lilyan
 * @Date 2022/11/11 10:48
 * @Vsersion V1.0
 * @Projrct Name hotel_sys
 **/
@Data
public  class  JsonResult <T> {
    private Integer code;
    private String message;
    private T data;

    public static<T> JsonResult ok(){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(200);
        jsonResult.message = "成功";
       return jsonResult;
    }

    public static<T> JsonResult fail(){
        JsonResult jsonResult = new JsonResult();
        jsonResult.setCode(-1);
        jsonResult.message = "失败";
        return jsonResult;
    }
}
